package com.kaiwukj.android.ufamily.mvp.ui.page.account.login;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.kaiwukj.android.ufamily.R;

import java.util.List;

public class LoginWayAdapter extends BaseQuickAdapter<LoginWayItemEntity, BaseViewHolder> {
    public LoginWayAdapter(@Nullable List<LoginWayItemEntity> data) {
        super(R.layout.item_login_way, data);
    }

    public int getLoginWay(int pos) {
        LoginWayItemEntity itemEntity = getItem(pos);
        if (itemEntity == null) return 0;
        return itemEntity.getWay();
    }

    @Override
    protected void convert(BaseViewHolder helper, LoginWayItemEntity item) {
        helper.setImageResource(R.id.iv_way, item.getResId());
        helper.setText(R.id.tv_way, item.getText());
    }
}
